#pragma once
#include "hzpch.h"
#include "Core.h"
#include "Events/Event.h"

/*
 * WindowProps是参数
 * 创建窗口用的
 * */
namespace Hazel {
    struct WindowProps {
        std::string Title;
        // unsigned不允许为零
        unsigned int Width;
        unsigned int Height;

        WindowProps(const std::string& title = "hazel engine",
                    unsigned int width = 1280,
                    unsigned int height = 720)
                    : Title(title) ,Width(width),Height(height){}

    };

    class  Window{
    public:
        // using 别名或者说引入
        using EventCallbackFn = std::function<void(Event&)>;
        virtual ~Window() = default;

        virtual void OnUpdate() = 0;
        virtual unsigned int GetWidth() const = 0;
        virtual unsigned int GetHeight() const = 0;

        virtual void SetEventCallback(const EventCallbackFn& callback) = 0;
        virtual void SetVSync(bool enabled) = 0;
        virtual bool IsVSync() const = 0;

        virtual GLFWwindow* GetNativeWindow(){return nullptr;};

        virtual void GetPixelSize(uint32_t& width, uint32_t& height) const {
            width = GetWidth();
            height = GetHeight();
        };

        static Scope<Window> Create(const WindowProps& props = WindowProps());
    };
}